package com.googlecode.uipipedream.spec;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.MouseListener;
import java.util.Observable;
import java.util.Observer;

/**
 * <p>
 * Represents an observable instance of a generic sliderbar. Please extend
 * Canvas to paint slider bars and implement these methods.
 * </p>
 * 
 * <p>
 * This file is part of UIPipeDream.
 * </p>
 * 
 * <p>
 * You can redistribute UIPipeDream and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 * </p>
 * 
 * <p>
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * </p>
 * 
 * <p>
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <a
 * href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
 * </p>
 * 
 * @author <a href="http://daemonsadvocate.blogspot.com/">Matthew B. Gray</a>
 * @author James Jones
 * @version 1.0 Final
 */
public abstract class SliderBar extends Canvas implements Observer {
	private static final long serialVersionUID = -3590980110547698489L;
	
	public SliderBar(ColourModel model) {
		model.addObserver(this);
		this.setBackground(Color.black);
	}
	
	@Override public synchronized void update(Graphics g) { paint(g); }
	@Override public void update(Observable o, Object arg) { repaint(); }
	
	@Override public abstract void paint(Graphics g);
	@Override public abstract Dimension preferredSize();
	@Override public abstract Dimension minimumSize();
//	@Override public abstract boolean mouseDrag(Event e, int x, int y);
//	@Override public abstract boolean mouseDown(Event e, int x, int y);
	
}